$.get("/article_page", data => {
    console.log(data);
    data.forEach((item, i) => {
        if (i == 0) {
            $("#timeline").append($(`<li>
            <h3>${data[0].publishTime.substr(0, 7)}</h3>
        </li>`))
        }
        if (i >= 1 && item.publishTime.substr(0, 7) !== data[i - 1].publishTime.substr(0, 7)) {
            $("#timeline").append($(`<li>
            <h3>${item.publishTime.substr(0, 7)}</h3>
        </li>`))
        }
        $('#timeline h2>span').text(data.length)
        $("#timeline").append($(`<li>
                                    <img src="./img/05.jpg" alt="">
                                    <a href="./details.html?id=${item.id}">
                                        <time>${item.publishTime}</time>
                                        <div class="title">${item.title}</div>
                                    </a>
                                </li>`))
    });
})